import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("device_id", ["deviceId"], {})
@Entity("device_port", { schema: "cabinet" })
export class DevicePort {
  @PrimaryGeneratedColumn({ type: "int", name: "port_id", unsigned: true })
  portId: number;

  @Column("tinyint", { name: "port_no", unsigned: true, default: () => "'0'" })
  portNo: number;

  @Column("int", { name: "device_id", unsigned: true, default: () => "'0'" })
  deviceId: number;

  @Column("int", {
    name: "battery_id",
    comment: "电池ID",
    unsigned: true,
    default: () => "'0'",
  })
  batteryId: number;

  @Column("tinyint", { name: "status", default: () => "'0'" })
  status: number;
}
